package com.liu.controller;

import com.liu.utils.KaptchaUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

/**
 * @author yangl
 * @version 1.0
 * @date 2022/11/8 16:57
 */

@RestController
@RequestMapping("admin")
public class AdminController {


    @RequestMapping("createCaptcha")
    public void createCaptcha(HttpSession session, HttpServletResponse response) throws IOException {

        KaptchaUtil.createKaptchaImg(session,response);

        System.out.println("验证码结果：" + session.getAttribute("code").toString());
    }

}
